package com.cyj.springioc3.service.impl;

import com.cyj.springioc3.mapper.IUserMapper;
import com.cyj.springioc3.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.annotation.Resource;

/**
 * @description:
 * @Author C_Y_J
 * @create 2021-02-24 15:41
 **/
public class UserServiceImpl implements IUserService {

    private IUserMapper userMapper;

//    public void setUserMapper(IUserMapper mapper) {
//        this.mapper = mapper;
//    }


    public UserServiceImpl(IUserMapper userMapper) {
        this.userMapper = userMapper;
    }

    public UserServiceImpl() {
        System.out.println("UserServiceImpl创建了...");
    }

    public void init() {
        System.out.println("初始化方法...");
    }

    public void destory() {
        System.out.println("销毁方法...");
    }

    @Override
    public void save() {
        userMapper.save();
    }
}
